package cn.kgc.service.impl;

import cn.kgc.entity.ResumeEducation;
import cn.kgc.mapper.ResumeEducationMapper;
import cn.kgc.service.ResumeEducationService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author example
 * @version 1.0
 */
@Slf4j
@Service("resumeEducationService")
@SuppressWarnings("all")
public class ResumeEducationServiceImpl extends ServiceImpl<ResumeEducationMapper, ResumeEducation> implements ResumeEducationService {

    @Override
    public List<ResumeEducation> queryResumeEducationByResumeId(String resumeId, String userId) {
        LambdaQueryWrapper<ResumeEducation>  wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(ResumeEducation::getResumeId, resumeId);
        wrapper.eq(ResumeEducation::getUserId, userId);
        wrapper.orderByDesc(ResumeEducation::getEndDate);
        return list(wrapper);
    }

}